package Spring5.第二章.demo2_3_单例模式;

/**
 * 饿汉静态单例模式
 */
public class HungaryStaticSingleton {
    private static final HungaryStaticSingleton hungaryStaticSingleton;

    static {
        hungaryStaticSingleton = new HungaryStaticSingleton();
    }

    private HungaryStaticSingleton(){};

    public static HungaryStaticSingleton getInstance() {
        return hungaryStaticSingleton;
    }
}
